from django.db import models


# Create your models here.

# 分类表
class Cate(models.Model):
    name = models.CharField(max_length=32)

    class Meta:
        db_table = '分类'


# 商品表
class Goods(models.Model):
    name = models.CharField(max_length=32)
    pirce = models.DecimalField(max_digits=9, decimal_places=2)
    cate = models.ForeignKey('Cate', on_delete=models.CASCADE)
    img = models.ImageField(upload_to='img')

    class Meta:
        db_table = '商品'
